package com.sanbi.erp.core.system;

import com.github.houbb.property.bs.PropertyBs;
import com.sanbi.erp.core.config.MessageCodeConfig;

/**
 * @author wanggang
 * @desc 订单状态枚举工具
 * @time 2022/8/9 17:41
 */
public class MessageEnum {
    //待支付
    private static final Integer WaitPaymentCode;
    private static final String WaitPaymentMessage;
    //已取消支付
    private static final Integer CanceledPayCode;
    private static final String CanceledPayMessage;
    //已自动取消支付 （系统）
    private static final Integer CancelledAutomaticallyCode;
    private static final String CancelledAutomaticallyMessage;
    //支付失败
    private static final Integer PaymentFailedCode;
    private static final String PaymentFailedMessage;
    //支付处理中
    private static final Integer PaymentHasBeenCode;
    private static final String PaymentHasBeenMessage;
    //支付处理中（审核中）
    private static final Integer PaymentHasBeenAuditCode;
    private static final String PaymentHasBeenAuditMessage;
    //待发货
    private static final Integer WaitShipmentsCode;
    private static final String WaitShipmentsMessage;
    //待发货（取消退款）
    private static final Integer WaitShipmentsRefundCode;
    private static final String WaitShipmentsRefundMessage;
    //待发货 (发货失败)
    private static final Integer WaitShipmentsFailCode;
    private static final String WaitShipmentsFailMessage;
    //退款申请中
    private static final Integer RefundApplicationCode;
    private static final String RefundApplicationMessage;
    //退款处理中
    private static final Integer RefundInHandCode;
    private static final String RefundInHandMessage;
    //退款申请失败（拒绝退款）
    private static final Integer RefundInHandFailCode;
    private static final String RefundInHandFailMessage;
    //退款成功
    private static final Integer RefundSucceedCode;
    private static final String RefundSucceedMessage;
    //退款失败
    private static final Integer RefundFailCode;
    private static final String RefundFailMessage;
    //待收货
    private static final Integer WaitReceivingCode;
    private static final String WaitReceivingMessage;
    //待收货（取消退货）
    private static final Integer CancelReturnsCode;
    private static final String CancelReturnsMessage;
    //退货申请中
    private static final Integer ReturnsApplicationCode;
    private static final String ReturnsApplicationMessage;
    //退货信息待补充（同意退货）
    private static final Integer ReturnsWaitReplenishCode;
    private static final String ReturnsWaitReplenishMessage;
    // 退货申请失败（拒绝退货）
    private static final Integer ReturnsApplicationFailCode;
    private static final String ReturnsApplicationFailMessage;
    //退货处理中（待确认退货）
    private static final Integer ReturnsDisposeCode;
    private static final String ReturnsDisposeMessage;
    //退货退款成功
    private static final Integer ReturnsRefundSucceedCode;
    private static final String ReturnsRefundSucceedMessage;
    //待评价
    private static final Integer WaitEvaluateCode;
    private static final String WaitEvaluateMessage;
    //已评价
    private static final Integer AlreadyEvaluateCode;
    private static final String AlreadyEvaluateMessage;
    //已评价（系统）
    private static final Integer SystemAlreadyEvaluateCode;
    private static final String SystemAlreadyEvaluateMessage;
    //已回复
    private static final Integer AlreadyRepliedCode;
    private static final String AlreadyRepliedMessage;
    //部分待评价
    private static final Integer PartWaitEvaluateCode;
    private static final String PartWaitEvaluateMessage;
    // 已完成
    private static final Integer AlreadyFinishCode;
    private static final String AlreadyFinishMessage;

    //（售后订单校验参数值 > 500000）
    private static final Integer IsAfterSaleCount;


    // ---------------------------------------退款订单状态----------------------------------------------XYP
    // 退款申请
    private static final Integer REFUND_ORDER_APPLY_FOR_CODE;
    private static final String REFUND_ORDER_APPLY_FOR_MESSAGE;
    // 退款处理中
    private static final Integer REFUND_ORDER_BEING_PROCESSED_CODE;
    private static final String REFUND_ORDER_BEING_PROCESSED_MESSAGE;
    // 拒绝退款
    private static final Integer REFUND_ORDER_REJECT_REFUND_CODE;
    private static final String REFUND_ORDER_REJECT_REFUND_MESSAGE;
    // 退款成功
    private static final Integer REFUND_ORDER_OK_CODE;
    private static final String REFUND_ORDER_OK_MESSAGE;
    // 退款失败
    private static final Integer REFUND_ORDER_FAILING_CODE;
    private static final String REFUND_ORDER_FAILING_MESSAGE;

    // 支付方式：1. 乒乓支付，2 淘金币支付
    public static final String PAY_ORDER_TYPE_NAME_PINGPONG;
    public static final String PAY_ORDER_TYPE_NAME_EASYTAO;

    // 退货申请
    private static final Integer RETURN_ORDER_TWO_CODE;
    private static final String RETURN_ORDER_TWO_MESSAGE;
    // 待收货
    private static final Integer RETURN_ORDER_THREE_CODE;
    private static final String RETURN_ORDER_THREE_MESSAGE;
    // 退货信息待补充
    private static final Integer RETURN_ORDER_FOUR_CODE;
    private static final String RETURN_ORDER_FOUR_MESSAGE;
    // 退货申请失败
    private static final Integer RETURN_ORDER_FIVE_CODE;
    private static final String RETURN_ORDER_FIVE_MESSAGE;
    // 退货处理中
    private static final Integer RETURN_ORDER_SIX_CODE;
    private static final String RETURN_ORDER_SIX_MESSAGE;
    // 退货退款成功
    private static final Integer RETURN_ORDER_SEVEN_CODE;
    private static final String RETURN_ORDER_SEVEN_MESSAGE;
    // 添加成功
    private static final String cartAddBySuccessMessage;
    // 订阅成功
    private static final String collectBySuccessMessage;
    // 取消订阅
    private static final String collectByCancelMessage;
    //领取成功
    private static final String CouponHasBeenCollectedMessage;
    //登陆成功
    private static final String LoginSuccessMessage;
    //发送成功
    private static final String SendSuccessMessage;
    //删除成功
    private static final String successfullyDeleteMessage;
    //密码修改成功，请重新登录。
    private static final String RetPasswordSuccessMessage;

    static {
        MessageCodeConfig config = new MessageCodeConfig();
        PropertyBs.getInstance("message.properties").asBean(config);
        //（售后订单校验参数值 > 500000）
        IsAfterSaleCount = config.getIsAfterSaleCount();
        // 添加成功
        cartAddBySuccessMessage = config.getCartAddBySuccessMessage();
        //删除成功
        successfullyDeleteMessage = config.getSuccessfullyDeleteMessage();
        // 订阅成功
        collectBySuccessMessage = config.getCollectBySuccessMessage();
        // 取消订阅
        collectByCancelMessage = config.getCollectByCancelMessage();
        //领取成功
        CouponHasBeenCollectedMessage = config.getCouponHasBeenCollectedMessage();
        //登陆成功
        LoginSuccessMessage = config.getLoginSuccessMessage();
        //发送成功
        SendSuccessMessage = config.getSendSuccessMessage();
        RetPasswordSuccessMessage = config.getRetPasswordSuccessMessage();
        //待支付
        WaitPaymentCode = config.getWaitPaymentCode();
        WaitPaymentMessage = config.getWaitPaymentMessage();
        //已取消支付
        CanceledPayCode = config.getCanceledPayCode();
        CanceledPayMessage = config.getCanceledPayMessage();
        //已自动取消支付 （系统）
        CancelledAutomaticallyCode = config.getCancelledAutomaticallyCode();
        CancelledAutomaticallyMessage = config.getCancelledAutomaticallyMessage();
        //支付失败
        PaymentFailedCode = config.getPaymentFailedCode();
        PaymentFailedMessage = config.getPaymentFailedMessage();
        //支付处理中
        PaymentHasBeenCode = config.getPaymentHasBeenCode();
        PaymentHasBeenMessage = config.getPaymentHasBeenMessage();
        //支付处理中（审核中）
        PaymentHasBeenAuditCode = config.getPaymentHasBeenAuditCode();
        PaymentHasBeenAuditMessage = config.getPaymentHasBeenAuditMessage();
        ////待发货
        WaitShipmentsCode = config.getWaitShipmentsCode();
        WaitShipmentsMessage = config.getWaitShipmentsMessage();
        //待发货（取消退款）
        WaitShipmentsRefundCode = config.getWaitShipmentsRefundCode();
        WaitShipmentsRefundMessage = config.getWaitShipmentsRefundMessage();
        //待发货 (发货失败)
        WaitShipmentsFailCode = config.getWaitShipmentsFailCode();
        WaitShipmentsFailMessage = config.getWaitShipmentsFailMessage();
        //退款申请中
        RefundApplicationCode = config.getRefundApplicationCode();
        RefundApplicationMessage = config.getRefundApplicationMessage();
        //退款处理中
        RefundInHandCode = config.getRefundInHandCode();
        RefundInHandMessage = config.getRefundInHandMessage();
        //退款申请失败（拒绝退款）
        RefundInHandFailCode = config.getRefundInHandFailCode();
        RefundInHandFailMessage = config.getRefundInHandFailMessage();
        //退款成功
        RefundSucceedCode = config.getRefundSucceedCode();
        RefundSucceedMessage = config.getRefundSucceedMessage();
        //退款失败
        RefundFailCode = config.getRefundFailCode();
        RefundFailMessage = config.getRefundFailMessage();
        //待收货
        WaitReceivingCode = config.getWaitReceivingCode();
        WaitReceivingMessage = config.getWaitReceivingMessage();
        //待收货（取消退货）
        CancelReturnsCode = config.getCancelReturnsCode();
        CancelReturnsMessage = config.getCancelReturnsMessage();
        //退货申请中
        ReturnsApplicationCode = config.getReturnsApplicationCode();
        ReturnsApplicationMessage = config.getReturnsApplicationMessage();
        //退货信息待补充（同意退货）
        ReturnsWaitReplenishCode = config.getReturnsWaitReplenishCode();
        ReturnsWaitReplenishMessage = config.getReturnsWaitReplenishMessage();
        // 退货申请失败（拒绝退货）
        ReturnsApplicationFailCode = config.getReturnsApplicationFailCode();
        ReturnsApplicationFailMessage = config.getReturnsApplicationFailMessage();
        //退货处理中（待确认退货）
        ReturnsDisposeCode = config.getReturnsDisposeCode();
        ReturnsDisposeMessage = config.getReturnsDisposeMessage();
        //退货退款成功
        ReturnsRefundSucceedCode = config.getReturnsRefundSucceedCode();
        ReturnsRefundSucceedMessage = config.getReturnsRefundSucceedMessage();
        //待评价
        WaitEvaluateCode = config.getWaitEvaluateCode();
        WaitEvaluateMessage = config.getWaitEvaluateMessage();
        //已评价
        AlreadyEvaluateCode = config.getAlreadyEvaluateCode();
        AlreadyEvaluateMessage = config.getAlreadyEvaluateMessage();
        //已评价（系统）
        SystemAlreadyEvaluateCode = config.getSystemAlreadyEvaluateCode();
        SystemAlreadyEvaluateMessage = config.getSystemAlreadyEvaluateMessage();
        //已回复
        AlreadyRepliedCode = config.getAlreadyRepliedCode();
        AlreadyRepliedMessage = config.getAlreadyRepliedMessage();
        //部分待评价
        PartWaitEvaluateCode = config.getPartWaitEvaluateCode();
        PartWaitEvaluateMessage = config.getPartWaitEvaluateMessage();
        //已完成
        AlreadyFinishCode = config.getAlreadyFinishCode();
        AlreadyFinishMessage = config.getAlreadyFinishMessage();

        // ---------------------------------------退款订单状态----------------------------------------------XYP
        // 退款申请
        REFUND_ORDER_APPLY_FOR_CODE = config.getRefundOrderApplyForCode();
        REFUND_ORDER_APPLY_FOR_MESSAGE = config.getRefundOrderApplyForMessage();
        // 退款处理中
        REFUND_ORDER_BEING_PROCESSED_CODE = config.getRefundOrderBeingProcessedCode();
        REFUND_ORDER_BEING_PROCESSED_MESSAGE = config.getRefundOrderBeingProcessedMessage();
        // 拒绝退款
        REFUND_ORDER_REJECT_REFUND_CODE = config.getRefundOrderRejectRefundCode();
        REFUND_ORDER_REJECT_REFUND_MESSAGE = config.getRefundOrderRejectRefundMessage();
        // 退款成功
        REFUND_ORDER_OK_CODE = config.getRefundOrderOkCode();
        REFUND_ORDER_OK_MESSAGE = config.getRefundOrderOkMessage();
        // 退款失败
        REFUND_ORDER_FAILING_CODE = config.getRefundOrderFailingCode();
        REFUND_ORDER_FAILING_MESSAGE = config.getRefundOrderFailingMessage();

        // 支付方式：1. 乒乓支付，2 淘金币支付
        PAY_ORDER_TYPE_NAME_PINGPONG = config.getPayOrderTypeNamePingPong();
        PAY_ORDER_TYPE_NAME_EASYTAO = config.getPayOrderTypeNameEasyTao();

        // 退货申请
        RETURN_ORDER_TWO_CODE = config.getReturnOrderTwoCode();
        RETURN_ORDER_TWO_MESSAGE = config.getReturnOrderTwoMessage();
        // 待收货
        RETURN_ORDER_THREE_CODE = config.getReturnOrderThreeCode();
        RETURN_ORDER_THREE_MESSAGE = config.getReturnOrderThreeMessage();
        // 退货信息待补充
        RETURN_ORDER_FOUR_CODE = config.getReturnOrderFourCode();
        RETURN_ORDER_FOUR_MESSAGE = config.getReturnOrderFourMessage();
        // 退货申请失败
        RETURN_ORDER_FIVE_CODE = config.getReturnOrderFiveCode();
        RETURN_ORDER_FIVE_MESSAGE = config.getReturnOrderFiveMessage();
        // 退货处理中
        RETURN_ORDER_SIX_CODE = config.getReturnOrderSixCode();
        RETURN_ORDER_SIX_MESSAGE = config.getReturnOrderSixMessage();
        // 退货退款成功
        RETURN_ORDER_SEVEN_CODE = config.getReturnOrderSevenCode();
        RETURN_ORDER_SEVEN_MESSAGE = config.getReturnOrderSevenMessage();
    }

    public enum ShoppingOrderStatus {
        //（售后订单校验参数值 > 500000）
        IFAfterSaleCount(IsAfterSaleCount, null),
        //优惠券领取成功
        CouponHasBeenCollected(null, CouponHasBeenCollectedMessage),
        //待支付
        WaitPayment(WaitPaymentCode, WaitPaymentMessage),
        //已取消支付
        CanceledPay(CanceledPayCode, CanceledPayMessage),
        //已自动取消支付 （系统）
        CancelledAutomatically(CancelledAutomaticallyCode, CancelledAutomaticallyMessage),
        //支付失败
        PaymentFailed(PaymentFailedCode, PaymentFailedMessage),
        //支付处理中
        PaymentHasBeen(PaymentHasBeenCode, PaymentHasBeenMessage),
        //支付处理中（审核中）
        PaymentHasBeenAudit(PaymentHasBeenAuditCode, PaymentHasBeenAuditMessage),
        //待发货
        WaitShipments(WaitShipmentsCode, WaitShipmentsMessage),
        //待发货（取消退款）
        WaitShipmentsRefund(WaitShipmentsRefundCode, WaitShipmentsRefundMessage),
        //待发货 (发货失败)
        WaitShipmentsFail(WaitShipmentsFailCode, WaitShipmentsFailMessage),

        //退款申请中
        RefundApplication(RefundApplicationCode, RefundApplicationMessage),
        //退款处理中
        RefundInHand(RefundInHandCode, RefundInHandMessage),
        //退款申请失败（拒绝退款）
        RefundInHandFail(RefundInHandFailCode, RefundInHandFailMessage),
        //退款成功
        RefundSucceed(RefundSucceedCode, RefundSucceedMessage),
        //退款失败
        RefundFail(RefundFailCode, RefundFailMessage),

        //待收货
        WaitReceiving(WaitReceivingCode, WaitReceivingMessage),
        //待收货（取消退货）
        CancelReturns(CancelReturnsCode, CancelReturnsMessage),

        //退货申请中
        ReturnsApplication(ReturnsApplicationCode, ReturnsApplicationMessage),
        //退货信息待补充（同意退货）
        ReturnsWaitReplenish(ReturnsWaitReplenishCode, ReturnsWaitReplenishMessage),
        // 退货申请失败（拒绝退货）
        ReturnsApplicationFail(ReturnsApplicationFailCode, ReturnsApplicationFailMessage),
        //退货处理中（待确认退货）
        ReturnsDispose(ReturnsDisposeCode, ReturnsDisposeMessage),
        //退货退款成功
        ReturnsRefundSucceed(ReturnsRefundSucceedCode, ReturnsRefundSucceedMessage),

        //待评价
        WaitEvaluate(WaitEvaluateCode, WaitEvaluateMessage),
        //已评价
        AlreadyEvaluate(AlreadyEvaluateCode, AlreadyEvaluateMessage),
        //已评价（系统）
        SystemAlreadyEvaluate(SystemAlreadyEvaluateCode, SystemAlreadyEvaluateMessage),
        //已回复
        AlreadyReplied(AlreadyRepliedCode, AlreadyRepliedMessage),
        //部分待评价
        PartWaitEvaluate(PartWaitEvaluateCode, PartWaitEvaluateMessage),
        // 已完成
        AlreadyFinish(AlreadyFinishCode, AlreadyFinishMessage),
        // ---------------------------------------退款退货订单状态----------------------------------------------XYP
        RefundOrderApply(REFUND_ORDER_APPLY_FOR_CODE, REFUND_ORDER_APPLY_FOR_MESSAGE),
        RefundOrderBeingProcessed(REFUND_ORDER_BEING_PROCESSED_CODE, REFUND_ORDER_BEING_PROCESSED_MESSAGE),
        RefundOrderRejectRefund(REFUND_ORDER_REJECT_REFUND_CODE, REFUND_ORDER_REJECT_REFUND_MESSAGE),
        RefundOrderOk(REFUND_ORDER_OK_CODE, REFUND_ORDER_OK_MESSAGE),
        RefundOrderFailing(REFUND_ORDER_FAILING_CODE, REFUND_ORDER_FAILING_MESSAGE),
        ReturnOrderTwo(RETURN_ORDER_TWO_CODE, RETURN_ORDER_TWO_MESSAGE),
        ReturnOrderThree(RETURN_ORDER_THREE_CODE, RETURN_ORDER_THREE_MESSAGE),
        ReturnOrderFour(RETURN_ORDER_FOUR_CODE, RETURN_ORDER_FOUR_MESSAGE),
        ReturnOrderFive(RETURN_ORDER_FIVE_CODE, RETURN_ORDER_FIVE_MESSAGE),
        ReturnOrderSix(RETURN_ORDER_SIX_CODE, RETURN_ORDER_SIX_MESSAGE),
        ReturnOrderSeven(RETURN_ORDER_SEVEN_CODE, RETURN_ORDER_SEVEN_MESSAGE),
        // 添加成功
        cartAddBySuccess(null, cartAddBySuccessMessage),
        // 订阅成功
        collectBySuccess(null, collectBySuccessMessage),
        // 取消订阅
        collectByCancel(null, collectByCancelMessage),
        //登陆成功
        LoginSuccess(null, LoginSuccessMessage),
        //密码修改成功，请重新登录。
        RetPasswordSuccess(null, RetPasswordSuccessMessage),
        //删除成功
        successfullyDelete(null, successfullyDeleteMessage),
        //发送成功
        SendSuccess(null, SendSuccessMessage);

        private final Integer code;
        private final String message;

        ShoppingOrderStatus(Integer code, String message) {
            this.code = code;
            this.message = message;
        }

        public Integer getCode() {
            return code;
        }

        public String getMessage() {
            return message;
        }
    }

}
